<!DOCTYPE html>
<html>
<head>
    

    
<!-- Tencent Speed -->
<script>var _speedMark = new Date()</script>
<!-- End Tencent Speed -->
<!-- Tencent Analysis -->
<script async src="//tajs.qq.com/stats?sId=61422473"></script>
<!-- End Tencent Analysis -->


    



    <meta charset="utf-8">
    
    
    
    <title>SpringBoot-Mybatis_Plus学习记录之公共字段自动填充 | z77z的小码窝 | 年少无为，卖码为生。</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    
    <meta name="theme-color" content="#ffff00">
    
    
    <meta name="keywords" content="springboot,mybatisplus">
    <meta name="description" content="一.应用场景
平时在建对象表的时候都会有最后修改时间，最后修改人这两个字段，对于这些大部分表都有的字段，每次在新增和修改的时候都要考虑到这几个字段有没有传进去，很麻烦。mybatisPlus有一个很好的解决方案。也就是公共字段自动填充的功能。一般满足下面条件的字段就可以使用此功能：

这个字段是大部分表都会有的。

这个字段的值是固定的，或则字段值是可以在后台动态获取的。

常用的就是last_u">
<meta property="og:type" content="article">
<meta property="og:title" content="SpringBoot-Mybatis_Plus学习记录之公共字段自动填充">
<meta property="og:url" content="http://z77z.oschina.io/2017/04/23/SpringBoot-Mybatis_Plus学习记录之公共字段自动填充/index.html">
<meta property="og:site_name" content="z77z的小码窝">
<meta property="og:description" content="一.应用场景
平时在建对象表的时候都会有最后修改时间，最后修改人这两个字段，对于这些大部分表都有的字段，每次在新增和修改的时候都要考虑到这几个字段有没有传进去，很麻烦。mybatisPlus有一个很好的解决方案。也就是公共字段自动填充的功能。一般满足下面条件的字段就可以使用此功能：

这个字段是大部分表都会有的。

这个字段的值是固定的，或则字段值是可以在后台动态获取的。

常用的就是last_u">
<meta property="og:updated_time" content="2017-04-23T11:53:36.486Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="SpringBoot-Mybatis_Plus学习记录之公共字段自动填充">
<meta name="twitter:description" content="一.应用场景
平时在建对象表的时候都会有最后修改时间，最后修改人这两个字段，对于这些大部分表都有的字段，每次在新增和修改的时候都要考虑到这几个字段有没有传进去，很麻烦。mybatisPlus有一个很好的解决方案。也就是公共字段自动填充的功能。一般满足下面条件的字段就可以使用此功能：

这个字段是大部分表都会有的。

这个字段的值是固定的，或则字段值是可以在后台动态获取的。

常用的就是last_u">
    
        <link rel="alternate" type="application/atom+xml" title="z77z的小码窝" href="/atom.xml">
    
    <link rel="shortcut icon" href="/favicon.ico">
    <link rel="stylesheet" href="/css/style.css?v=1.4.3">
    <script>window.lazyScripts=[]</script>
</head>

<body>
    <div id="loading" class="active"></div>

    <aside id="menu" class="hide" >
  <div class="inner flex-row-vertical">
    <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menu-off">
        <i class="icon icon-lg icon-close"></i>
    </a>
    <div class="brand-wrap" style="background-image:url(/img/brand.jpg)">
      <div class="brand">
        <a href="/" class="avatar waves-effect waves-circle waves-light">
          <img src="/img/avatar.jpg">
        </a>
        <hgroup class="introduce">
          <h5 class="nickname">邹海清</h5>
          <a href="mailto:1093615728@qq.com" title="1093615728@qq.com" class="mail">1093615728@qq.com</a>
        </hgroup>
      </div>
    </div>
    <div class="scroll-wrap flex-col">
      <ul class="nav">
        
            <li class="waves-block waves-effect">
              <a href="/"  >
                <i class="icon icon-lg icon-home"></i>
                主页
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/archives"  >
                <i class="icon icon-lg icon-archives"></i>
                归档
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/tags"  >
                <i class="icon icon-lg icon-tags"></i>
                标签
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://git.oschina.net/z77z" target="_blank" >
                <i class="icon icon-lg icon-git"></i>
                git
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="http://t.qq.com/zouhaiqing123" target="_blank" >
                <i class="icon icon-lg icon-weibo"></i>
                微博
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/custom"  >
                <i class="icon icon-lg icon-link"></i>
                404页面测试
              </a>
            </li>
        
      </ul>
    </div>
  </div>
</aside>

    <main id="main">
        <header class="top-header" id="header">
    <div class="flex-row">
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light on" id="menu-toggle">
          <i class="icon icon-lg icon-navicon"></i>
        </a>
        <div class="flex-col header-title ellipsis">SpringBoot-Mybatis_Plus学习记录之公共字段自动填充</div>
        
        <div class="search-wrap" id="search-wrap">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="back">
                <i class="icon icon-lg icon-chevron-left"></i>
            </a>
            <input type="text" id="key" class="search-input" autocomplete="off" placeholder="输入感兴趣的关键字">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="search">
                <i class="icon icon-lg icon-search"></i>
            </a>
        </div>
        
        
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menuShare">
            <i class="icon icon-lg icon-share-alt"></i>
        </a>
        
    </div>
</header>
<header class="content-header post-header">

    <div class="container fade-scale">
        <h1 class="title">SpringBoot-Mybatis_Plus学习记录之公共字段自动填充</h1>
        <h5 class="subtitle">
            
                <time datetime="2017-04-23T11:53:14.000Z" itemprop="datePublished" class="page-time">
  2017-04-23
</time>


            
        </h5>
    </div>

    


</header>


<div class="container body-wrap">
    
    <aside class="post-widget">
        <nav class="post-toc-wrap" id="post-toc">
            <h4>TOC</h4>
            <ol class="post-toc"><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#一-应用场景"><span class="post-toc-number">1.</span> <span class="post-toc-text">一.应用场景</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#二-配置MybatisPlus"><span class="post-toc-number">2.</span> <span class="post-toc-text">二.配置MybatisPlus</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#三-编写测试类"><span class="post-toc-number">3.</span> <span class="post-toc-text">三.编写测试类</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#四-测试日志"><span class="post-toc-number">4.</span> <span class="post-toc-text">四.测试日志</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#五-总结"><span class="post-toc-number">5.</span> <span class="post-toc-text">五.总结</span></a></li></ol>
        </nav>
    </aside>
    
<article id="post-SpringBoot-Mybatis_Plus学习记录之公共字段自动填充"
  class="post-article article-type-post fade" itemprop="blogPost">

    <div class="post-card">
        <h1 class="post-card-title">SpringBoot-Mybatis_Plus学习记录之公共字段自动填充</h1>
        <div class="post-meta">
            <time class="post-time" title="2017-04-23 19:53:14" datetime="2017-04-23T11:53:14.000Z"  itemprop="datePublished">2017-04-23</time>

            


            
<span id="busuanzi_container_page_pv" title="文章总阅读量" style='display:none'>
    <i class="icon icon-eye icon-pr"></i><span id="busuanzi_value_page_pv"></span>
</span>


            

        </div>
        <div class="post-content" id="post-content" itemprop="postContent">
            <h2 id="一-应用场景"><a href="#一-应用场景" class="headerlink" title="一.应用场景"></a>一.应用场景</h2><hr>
<p>平时在建对象表的时候都会有最后修改时间，最后修改人这两个字段，对于这些大部分表都有的字段，每次在新增和修改的时候都要考虑到这几个字段有没有传进去，很麻烦。mybatisPlus有一个很好的解决方案。也就是公共字段自动填充的功能。一般满足下面条件的字段就可以使用此功能：</p>
<ul>
<li><p>这个字段是大部分表都会有的。</p>
</li>
<li><p>这个字段的值是固定的，或则字段值是可以在后台动态获取的。</p>
</li>
<li><p>常用的就是last_update_time，last_update_name这两个字段。</p>
</li>
</ul>
<h2 id="二-配置MybatisPlus"><a href="#二-配置MybatisPlus" class="headerlink" title="二.配置MybatisPlus"></a>二.配置MybatisPlus</h2><hr>
<p><strong>导包：</strong>只需要注意的一点就是，mybatisPlus是在2.0.6版本才支持的更新数据公共字段自动填充，之前都是只支持新增数据的时候可以使用。</p>
<p>如果是之前配置过MybatisPlus的同学只需要添加以下几个步骤：</p>
<ol>
<li>继承IMetaObjectHandler抽象类，实现<code>insertFill()</code>新增数据时需要填充的字段设置和<code>updateFill()</code>更新数据的时候需要填充的字段设置这两个方法：</li>
</ol>
<figure class="highlight java"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div><div class="line">35</div><div class="line">36</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">package</span> io.z77z.util;</div><div class="line"></div><div class="line"><span class="keyword">import</span> java.util.Date;</div><div class="line"></div><div class="line"><span class="keyword">import</span> org.apache.ibatis.reflection.MetaObject;</div><div class="line"><span class="keyword">import</span> org.apache.shiro.SecurityUtils;</div><div class="line"><span class="keyword">import</span> org.springframework.stereotype.Component;</div><div class="line"></div><div class="line"><span class="keyword">import</span> com.baomidou.mybatisplus.mapper.MetaObjectHandler;</div><div class="line"></div><div class="line"><span class="keyword">import</span> io.z77z.entity.SysUser;</div><div class="line"></div><div class="line"><span class="comment">/** mybatisplus自定义填充公共字段 ,即没有传的字段自动填充*/</span></div><div class="line"><span class="meta">@Component</span></div><div class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">MyMetaObjectHandler</span> <span class="keyword">extends</span> <span class="title">MetaObjectHandler</span>  </span>&#123;</div><div class="line">	<span class="comment">//新增填充</span></div><div class="line">	<span class="meta">@Override</span></div><div class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">insertFill</span><span class="params">(MetaObject metaObject)</span> </span>&#123;</div><div class="line">		Object lastUpdateNameId = metaObject.getValue(<span class="string">"lastUpdateNameId"</span>);</div><div class="line">		Object lastUpdateTime = metaObject.getValue(<span class="string">"lastUpdateTime"</span>);</div><div class="line">		<span class="comment">//获取当前登录用户</span></div><div class="line">		SysUser user = (SysUser)SecurityUtils.getSubject().getPrincipal();</div><div class="line">		<span class="keyword">if</span> (<span class="keyword">null</span> == lastUpdateNameId) &#123;</div><div class="line">			metaObject.setValue(<span class="string">"lastUpdateNameId"</span>, user.getId());</div><div class="line">		&#125;</div><div class="line">		<span class="keyword">if</span> (<span class="keyword">null</span> == lastUpdateTime) &#123;</div><div class="line">			metaObject.setValue(<span class="string">"lastUpdateTime"</span>, <span class="keyword">new</span> Date());</div><div class="line">		&#125;</div><div class="line">	&#125;</div><div class="line"></div><div class="line">	<span class="comment">//更新填充</span></div><div class="line">	<span class="meta">@Override</span></div><div class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">updateFill</span><span class="params">(MetaObject metaObject)</span> </span>&#123;</div><div class="line">		insertFill(metaObject);</div><div class="line">	&#125;</div><div class="line">&#125;</div></pre></td></tr></table></figure>
<p>注意：getValue()方法的参数是pojo类里面的变量（驼峰的命名方式）。</p>
<ol>
<li>在mybatisplus的配置文件中公共字段生成类的bean：</li>
</ol>
<figure class="highlight java"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line"><span class="comment">// MP 全局配置，更多内容进入类看注释</span></div><div class="line">GlobalConfiguration globalConfig = <span class="keyword">new</span> GlobalConfiguration();</div><div class="line"><span class="comment">//配置公共字段自动填写</span></div><div class="line">globalConfig.setMetaObjectHandler(<span class="keyword">new</span> MyMetaObjectHandler());</div></pre></td></tr></table></figure>
<p>也就是将刚刚写的公共字段填充的设置设置到MP全局配置的对象中。</p>
<ol>
<li>填充的字段需要忽略验证，在表对象pojo类的对应属性上添加下面注解：</li>
</ol>
<figure class="highlight java"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div></pre></td><td class="code"><pre><div class="line"><span class="comment">/**</span></div><div class="line">  * 最后修改人Id</div><div class="line">  */</div><div class="line"><span class="meta">@TableField</span>(value=<span class="string">"last_update_id"</span>,validate=FieldStrategy.NOT_EMPTY)</div><div class="line"><span class="keyword">private</span> String lastUpdateNameId;</div><div class="line"><span class="comment">/**</span></div><div class="line">  * 最后修改时间</div><div class="line">  */</div><div class="line"><span class="meta">@TableField</span>(value=<span class="string">"last_update_time"</span>,validate=FieldStrategy.NOT_EMPTY)</div><div class="line"><span class="keyword">private</span> Date lastUpdateTime;</div></pre></td></tr></table></figure>
<p>原因：因为调用更新和插入的方法时，会验证你所传的属性是否为空，来判断是否该更新和插入这个属性，这个就和公共字段自动填充相冲突了，所以需要这个注解来标识此属性不需要验证。不然在插入的时候就会填充失败。</p>
<p>如果之前没有使用过MbatisPlus，可以出门左转，链接：<a href="http://z77z.oschina.io/2017/01/23/SpringBoot+SpringMVC+MybatisPlus%E6%A1%86%E6%9E%B6%E6%95%B4%E5%90%88%E7%BB%83%E4%B9%A0%E4%B9%8B%E3%80%90%E7%BE%8E%E5%A5%B3%E5%9B%BE%E7%89%87%E3%80%91%E7%88%AC%E8%99%AB---%E5%9B%BE%E6%96%87%E8%AF%A6%E7%BB%86%E6%B5%81%E7%A8%8B/">之前写过的一个博文，里面涉及到MybatisPlus的基础使用配置</a></p>
<h2 id="三-编写测试类"><a href="#三-编写测试类" class="headerlink" title="三.编写测试类"></a>三.编写测试类</h2><hr>
<figure class="highlight java"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div></pre></td><td class="code"><pre><div class="line"><span class="comment">//公共字段自动填充</span></div><div class="line"><span class="comment">//1.在mybatisplus的配置文件中公共字段生成类的bean</span></div><div class="line"><span class="comment">//2.实现IMetaObjectHandler类</span></div><div class="line"><span class="comment">//3.忽略对应字段的为空检测，在pojo类的属性上添加@TableField(value="last_update_name_id",validate=FieldStrategy.IGNORED)</span></div><div class="line"><span class="meta">@Test</span></div><div class="line"><span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">publicTest</span><span class="params">()</span></span>&#123;</div><div class="line">	SysUser user = <span class="keyword">new</span> SysUser();</div><div class="line">	user.setEmail(<span class="string">"1093615728@qq.com"</span>);</div><div class="line">	user.setNickname(<span class="string">"z77z"</span>);</div><div class="line">	user.setPswd(<span class="string">"123123"</span>);</div><div class="line">	user.setStatus(<span class="string">"1"</span>);</div><div class="line">	sysUserService.insert(user);</div><div class="line">	sysUserService.selectById(user.getId());</div><div class="line">	</div><div class="line">	SysUser user1 = <span class="keyword">new</span> SysUser();</div><div class="line">	user1.setPswd(<span class="string">"123"</span>);</div><div class="line">	user1.setId(user.getId());</div><div class="line">	sysUserService.updateById(user1);</div><div class="line">	sysUserService.selectById(user.getId());</div><div class="line">&#125;</div></pre></td></tr></table></figure>
<h2 id="四-测试日志"><a href="#四-测试日志" class="headerlink" title="四.测试日志"></a>四.测试日志</h2><hr>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div></pre></td><td class="code"><pre><div class="line">2017/04/23-19:35:26 [main] DEBUG io.z77z.dao.SysUserMapper.insert- ==&gt;  Preparing: INSERT INTO sys_user ( id, nickname, email, pswd, `status`,last_update_name_id, last_update_time ) VALUES ( ?, ?, ?, ?, ?,?, ? ) </div><div class="line">2017/04/23-19:35:26 [main] DEBUG io.z77z.dao.SysUserMapper.insert- ==&gt; Parameters: 6634923de4a14b6ca3bac5fdf31563a8(String), z77z(String), 1093615728@qq.com(String), 123123(String), 1(String), 123(String), 2017-04-23 19:35:26.58(Timestamp)</div><div class="line">2017/04/23-19:35:26 [main] DEBUG io.z77z.dao.SysUserMapper.insert- &lt;==    Updates: 1</div><div class="line">2017/04/23-19:35:26 [main] DEBUG io.z77z.dao.SysUserMapper.selectById- ==&gt;  Preparing: SELECT id,nickname,email,pswd,last_login_time AS lastLoginTime,`status`,last_update_name_id AS lastUpdateNameId,create_name_id AS createNameId,last_update_time AS lastUpdateTime,create_time AS createTime FROM sys_user WHERE id=? </div><div class="line">2017/04/23-19:35:26 [main] DEBUG io.z77z.dao.SysUserMapper.selectById- ==&gt; Parameters: 6634923de4a14b6ca3bac5fdf31563a8(String)</div><div class="line">2017/04/23-19:35:26 [main] DEBUG io.z77z.dao.SysUserMapper.selectById- &lt;==      Total: 1</div><div class="line">2017/04/23-19:35:26 [main] DEBUG io.z77z.dao.SysUserMapper.updateById- ==&gt;  Preparing: UPDATE sys_user SET pswd=?, last_update_name_id=?, last_update_time=? WHERE id=? </div><div class="line">2017/04/23-19:35:26 [main] DEBUG io.z77z.dao.SysUserMapper.updateById- ==&gt; Parameters: 123(String), 123(String), 2017-04-23 19:35:26.637(Timestamp), 6634923de4a14b6ca3bac5fdf31563a8(String)</div><div class="line">2017/04/23-19:35:26 [main] DEBUG io.z77z.dao.SysUserMapper.updateById- &lt;==    Updates: 1</div><div class="line">2017/04/23-19:35:26 [main] DEBUG io.z77z.dao.SysUserMapper.selectById- ==&gt;  Preparing: SELECT id,nickname,email,pswd,last_login_time AS lastLoginTime,`status`,last_update_name_id AS lastUpdateNameId,create_name_id AS createNameId,last_update_time AS lastUpdateTime,create_time AS createTime FROM sys_user WHERE id=? </div><div class="line">2017/04/23-19:35:26 [main] DEBUG io.z77z.dao.SysUserMapper.selectById- ==&gt; Parameters: 6634923de4a14b6ca3bac5fdf31563a8(String)</div><div class="line">2017/04/23-19:35:26 [main] DEBUG io.z77z.dao.SysUserMapper.selectById- &lt;==      Total: 1</div></pre></td></tr></table></figure>
<h2 id="五-总结"><a href="#五-总结" class="headerlink" title="五.总结"></a>五.总结</h2><hr>
<p>本来是打算创建人和创建时间，也使用这种方法处理的，最后发现，如果将这两个字段也忽略为空的判断，也就是加上<code>validate=FieldStrategy.NOT_EMPTY</code>，在更新数据的时候会将创建人和创建时间一起更新了，不传的话就会更新为空。所以本人觉得这个mybatisPlus这个公共字段自动填充功能是不错，但是在正真用的上的需求上面使用的时候还不够完善。</p>
<p>·······················································································································································</p>
<p>个人博客：<a href="http://z77z.oschina.io/">http://z77z.oschina.io/</a></p>
<p>此项目下载地址：<a href="https://git.oschina.net/z77z/springboot_mybatisplus" target="_blank" rel="external">https://git.oschina.net/z77z/springboot_mybatisplus</a></p>
<p>·······················································································································································</p>

        </div>

        <blockquote class="post-copyright">
    <div class="content">
        
<span class="post-time">
    最后更新时间：<time datetime="2017-04-23T11:53:36.486Z" itemprop="dateUpdated">2017-04-23 19:53:36</time>
</span><br>


        
    </div>
    <footer>
        <a href="http://z77z.oschina.io">
            <img src="/img/avatar.jpg" alt="邹海清">
            邹海清
        </a>
    </footer>
</blockquote>

        
<div class="page-reward">
    <a id="rewardBtn" href="javascript:;" class="page-reward-btn waves-effect waves-circle waves-light">赏</a>
</div>



        <div class="post-footer">
            
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/mybatisplus/">mybatisplus</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/springboot/">springboot</a></li></ul>


            
<div class="page-share-wrap">
    

<div class="page-share" id="pageShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=http://z77z.oschina.io/2017/04/23/SpringBoot-Mybatis_Plus学习记录之公共字段自动填充/&title=《SpringBoot-Mybatis_Plus学习记录之公共字段自动填充》 — z77z的小码窝&pic=http://z77z.oschina.io/img/avatar.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=http://z77z.oschina.io/2017/04/23/SpringBoot-Mybatis_Plus学习记录之公共字段自动填充/&title=《SpringBoot-Mybatis_Plus学习记录之公共字段自动填充》 — z77z的小码窝&source=" data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http://z77z.oschina.io/2017/04/23/SpringBoot-Mybatis_Plus学习记录之公共字段自动填充/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《SpringBoot-Mybatis_Plus学习记录之公共字段自动填充》 — z77z的小码窝&url=http://z77z.oschina.io/2017/04/23/SpringBoot-Mybatis_Plus学习记录之公共字段自动填充/&via=http://z77z.oschina.io" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=http://z77z.oschina.io/2017/04/23/SpringBoot-Mybatis_Plus学习记录之公共字段自动填充/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>



    <a href="javascript:;" id="shareFab" class="page-share-fab waves-effect waves-circle">
        <i class="icon icon-share-alt icon-lg"></i>
    </a>
</div>



        </div>
    </div>

    
<nav class="post-nav flex-row flex-justify-between">
  
    <div class="waves-block waves-effect prev">
      <a href="/2017/06/05/即时通讯框架T-io之WebSocket协议再之HelloWorld/" id="post-prev" class="post-nav-link">
        <div class="tips"><i class="icon icon-angle-left icon-lg icon-pr"></i> Prev</div>
        <h4 class="title">即时通讯框架T-io之WebSocket协议再之HelloWorld</h4>
      </a>
    </div>
  

  
    <div class="waves-block waves-effect next">
      <a href="/2017/04/04/java获取redis的日志信息和动态监控信息/" id="post-next" class="post-nav-link">
        <div class="tips">Next <i class="icon icon-angle-right icon-lg icon-pl"></i></div>
        <h4 class="title">java获取redis的日志信息和动态监控信息</h4>
      </a>
    </div>
  
</nav>



    










    <div id="cloud-tie-wrapper" class="comments cloud-tie-wrapper"></div>
    <script>
    var cloudTieConfig = {
        url: 'http://z77z.oschina.io/2017/04/23/SpringBoot-Mybatis_Plus学习记录之公共字段自动填充/index.html',
        sourceId: 'SpringBoot-Mybatis_Plus学习记录之公共字段自动填充',
        productKey: '64500aaa7f0a4f6f804c4df9b5880011',
        target: 'cloud-tie-wrapper',
        pcFiles: [
            '/css/cloudTie/pc.css?v=1.4.3',
            '/js/cloudTie/pc.min.js?v=1.4.3',
        ],
        mobileFiles: [
            '/css/cloudTie/mobile.css?v=1.4.3',
            '/js/cloudTie/mobile.min.js?v=1.4.3'
        ]
    };
    </script>
    <script src="/js/cloudTie/loader.min.js?v=1.4.3"></script>







</article>

<div id="reward" class="page-modal reward-lay">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <h3 class="reward-title">
        <i class="icon icon-quote-left"></i>
        我只要一角钱~ ~
        <i class="icon icon-quote-right"></i>
    </h3>
    <ul class="reward-items">
        
        <li>
            <img src="/img/wechat.png" title="微信打赏二维码" alt="微信打赏二维码">
            <p>微信</p>
        </li>
        

        
        <li>
            <img src="/img/alipay.jpg" title="支付宝打赏二维码" alt="支付宝打赏二维码">
            <p>支付宝</p>
        </li>
        
    </ul>
</div>



</div>

        <footer class="footer">
    <div class="top">
        
<p>
    <span id="busuanzi_container_site_uv" style='display:none'>
        站点总访客数：<span id="busuanzi_value_site_uv"></span>
    </span>
    <span id="busuanzi_container_site_pv" style='display:none'>
        站点总访问量：<span id="busuanzi_value_site_pv"></span>
    </span>
</p>


        <p>
            
                <span><a href="/atom.xml" target="_blank" class="rss" title="rss"><i class="icon icon-lg icon-rss"></i></a></span>
            
            <span>博客内容遵循<a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">知识共享 署名 - 非商业性 - 相同方式共享 4.0 国际协议</a></span>
        </p>
    </div>
    <div class="bottom">
        <p>
            <span>Power by <a href="http://hexo.io/" target="_blank">Hexo</a> Theme <a href="https://github.com/yscoder/hexo-theme-indigo" target="_blank">indigo</a></span>
            <span>邹海清 &copy; 2016 - 2017</span>
        </p>
    </div>
</footer>

    </main>
    <div class="mask" id="mask"></div>
<a href="javascript:;" id="gotop" class="waves-effect waves-circle waves-light"><span class="icon icon-lg icon-chevron-up"></span></a>



<div class="global-share" id="globalShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=http://z77z.oschina.io/2017/04/23/SpringBoot-Mybatis_Plus学习记录之公共字段自动填充/&title=《SpringBoot-Mybatis_Plus学习记录之公共字段自动填充》 — z77z的小码窝&pic=http://z77z.oschina.io/img/avatar.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=http://z77z.oschina.io/2017/04/23/SpringBoot-Mybatis_Plus学习记录之公共字段自动填充/&title=《SpringBoot-Mybatis_Plus学习记录之公共字段自动填充》 — z77z的小码窝&source=" data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http://z77z.oschina.io/2017/04/23/SpringBoot-Mybatis_Plus学习记录之公共字段自动填充/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《SpringBoot-Mybatis_Plus学习记录之公共字段自动填充》 — z77z的小码窝&url=http://z77z.oschina.io/2017/04/23/SpringBoot-Mybatis_Plus学习记录之公共字段自动填充/&via=http://z77z.oschina.io" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=http://z77z.oschina.io/2017/04/23/SpringBoot-Mybatis_Plus学习记录之公共字段自动填充/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>


<div class="page-modal wx-share" id="wxShare">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <p>扫一扫，分享到微信</p>
    <img src="" alt="微信分享二维码">
</div>




    <script src="//cdn.bootcss.com/node-waves/0.7.4/waves.min.js"></script>
<script>
var BLOG = { ROOT: '/', SHARE: true, REWARD: true };



lazyScripts.push('//s95.cnzz.com/z_stat.php?id=1261081671&web_id=1261081671')

</script>

<script src="/js/main.min.js?v=1.4.3"></script>


<div class="search-panel" id="search-panel">
    <ul class="search-result" id="search-result"></ul>
</div>
<template id="search-tpl">
<li class="item">
    <a href="{path}" class="waves-block waves-effect">
        <div class="title ellipsis" title="{title}">{title}</div>
        <div class="flex-row flex-middle">
            <div class="tags ellipsis">
                {tags}
            </div>
            <time class="flex-col time">{date}</time>
        </div>
    </a>
</li>
</template>

<script src="/js/search.min.js?v=1.4.3" async></script>






<script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>



<script>
(function() {
    var OriginTitile = document.title, titleTime;
    document.addEventListener('visibilitychange', function() {
        if (document.hidden) {
            document.title = '死鬼去哪里了！';
            clearTimeout(titleTime);
        } else {
            document.title = '(つェ⊂)咦!又好了!';
            titleTime = setTimeout(function() {
                document.title = OriginTitile;
            },2000);
        }
    });
})();
</script>



</body>
</html>
